home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000139_icon-group-sender_Thu Nov 2 08:03:02 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id eA2F1bo08597
  4.     for icon-group-addresses; Thu, 2 Nov 2000 08:01:37 -0700 (MST)
  5. Message-Id: <200011021501.eA2F1bo08597@baskerville.CS.Arizona.EDU>
  6. Date: Thu, 02 Nov 2000 05:52:01 -0600
  7. From: gep2@terabites.com
  8. Subject: How would the experts handle this...??
  9. To: icon-group@cs.arizona.edu
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: RO
  12. Content-Length: 1637
  13.  
  14. > I wish to scan thru a file and determine how letters "connect" with one
  15. another. 
  16.  
  17. Turns out that in fact this is a VERY interesting issue... character adjacency 
  18. is a key to a great many very interesting algorithms.
  19.  
  20. > By that I mean that for every letter of the alphabet, I would
  21. like to compile two lists: one containing all the letters which apper
  22. to the right of the given letter, and another for all those appearing
  23. to the left.
  24.  
  25. > Exmaple:
  26. For the line....
  27.  
  28. > "Cable television programming is...."
  29.  
  30. > The output would might look something like:
  31.  
  32. > A:  left- Cr
  33. >     right- bm
  34.  
  35. > B:  left- a
  36. >     right- l
  37.  
  38. One issue is immediately apparent here (to me)... and that is that in the one 
  39. case, it seems you're ignoring case issues (the A) and respecting them (the C).
  40.  
  41. Is that intentional?  You need to decide which it's going to be, and be 
  42. consistent each time.
  43.  
  44. > Thus far, I have been roundly criticized by icon afficiandos for my use
  45. of explicit indexing. It seems to me an intuitive way to handle the
  46. problems I've faced and makes the program "readable" to the layman.
  47.  
  48. I would join the list of those who are criticizing.  :-)  The whole point of 
  49. Icon is to eliminate this kind of error-prone "knit-one-purl-two" style of 
  50. C-type or BASIC-type programming.
  51.  
  52. Obviously, though, the solution ought to be a lot shorter and a lot higher level 
  53. when coded for Icon.  :-)
  54.  
  55. Gordon Peterson
  56. http://personal.terabites.com/
  57. Support the Anti-SPAM Amendment!  Join at http://www.cauce.org/
  58. 12/19/98: the day the Conservatives demonstrated their scorn for their
  59.    fraudulent sham of representative government.  Voters, remember it!
  60.  
  61.